


//
//  LoadingViewController.m
//  界面动画集
//
//  Created by YYY on 2017/7/4.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

#import "LoadingViewController.h"

#import "LoadingView.h"

@interface LoadingViewController ()

@property(nonatomic,strong)LoadingView *loadingView;

@end

@implementation LoadingViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"数据加载中";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.loadingView];
    
    //添加旋转动画
    [_loadingView startAnimation];
    
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [_loadingView stopAnimation];
    });
    // Do any additional setup after loading the view.
}

-(LoadingView *)loadingView
{
    if (!_loadingView)
    {
        _loadingView = [[LoadingView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
        //_loadingView.backgroundColor = [UIColor purpleColor];
        _loadingView.center = self.view.center;
    }
    return _loadingView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
